package com.cn.pack.controller;

import com.cn.pack.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping(path = "/user/query")
    public String query() {
        //缓存
        testService.get(1);
        testService.get(1);
        testService.get(1);

        //缓存清除，要想实现缓存和清除缓存，方法必须参数一致，输入值一致
        //testService.set(2);
        testService.set(1);

        //缓存
        testService.get(1);
        testService.get(1);
        testService.get(1);
        return "SUCCESS";
    }
}
